package com.apes.auto.car.model;

import com.apes.framework.jpa.DefaultPersistListener;
import com.apes.framework.jpa.Model;
import com.apes.framework.jpa.comment.Comment;
import com.apes.framework.jpa.generator.ApesGenerator;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.SelectBeforeUpdate;

import javax.persistence.*;

/**
 * @ClassName CustomCodeRules
 * @Description 自定义代码规则
 * @Author pengyb
 * @Date 2019/8/28 13:41
 * @Version 1.0
 **/
@Getter
@Setter
@Entity
@SelectBeforeUpdate
@DynamicInsert
@DynamicUpdate
@EntityListeners(DefaultPersistListener.class)
@Table(name = CustomCodeRules.CONST_TABLE_NAME)
public class CustomCodeRules  extends Model {
    public static final String CONST_TABLE_NAME = "dc_custom_code_rules";
    @Id
    @Column(name = "id", length = 60)
    @ApesGenerator(code = CONST_TABLE_NAME, name = "自定义代码规则",padding = 3)
    @Comment("编码")
    private String id;

    @Column(name = "code",length = 32)
    @Comment("自定义代码")
    private String code;


    @Column(name = "description",length = 60)
    @Comment("描述")
    private String description;
}
